package com.greak.netty_stude.length;

/**
 * Created on 2019/5/14.
 *
 * @author hy
 * @since 1.0
 */
public class RunApplication {

    public static void main(String[] args) {
        Server server = new Server(8000);
        Client client1 = new Client(8000,"127.0.0.1");
        Client client2 = new Client(8000,"127.0.0.1");
        Client client3 = new Client(8000,"127.0.0.1");
        new Thread(server).start();
        new Thread(client1).start();
        new Thread(client2).start();
        new Thread(client3).start();

        Runnable runnable = () -> {
            Thread top = Thread.currentThread();
            System.out.println("mainName:" + top.getName()+ "mainId:" + top.getId());
        };
        Server.getSingleThread().execute(runnable);
        Server.getSingleThread().execute(runnable);
        Server.getSingleThread().execute(runnable);
        Server.getSingleThread().execute(runnable);
    }
}
